import {
	loadModules as load
} from 'esri-loader'

import {
	config
} from "./config.js"

export const loadModules = () => {
	return new Promise((resolve, reject) => {
		load(Object.values(config.modules), config.options).then(res => {
			let _ = {},
				keys = Object.keys(config.modules);
			(res || []).map((item, index) => {
				_[keys[index]] = item
			})
			resolve(_)
		}).catch(err => {})
	})
}